<?php
require_once 'const/DBConst.php';
?>
<html>
    <head>
        <title>Hello Shop, </title>
        <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
        <link href="/css/admin/css.css" rel="stylesheet" type="text/css" />
        <script language="JavaScript" src="/jscript/admin/js.js"></script>
        <script language="JavaScript" src="/jscript/comm/divwindows.js"></script>
        <script language="javascript">
            function MP_jumpMenu(val) {
                location.href = "admincp.php?mid=5&lid=15&cid="+val;
            }
        </script>
    </head>
    <body>
        <div id="divMainBodyTop">
            <div class="fLeft"><img src="/images/default/admin/edit.gif" width="15" height="13"></div>
            <div>商品管理</div>
        </div>
        <div id="BodyContent">

            <ul id="ClassesMenu" onMouseOut="setSelectElement(document)" onMouseOver="setSelectElement(document, false)">
                <li id="menutitle"><a href="javascript:void(0)">选择 → 商品类别列表</a>
                    <ul id="title" class="scroll">
                        <?php foreach ($this->types as $type): ?>
                            <li class="fb l">
                                <span class="fLeft"><?php echo $type["NAME"] ?></span>
                                <a title="类别商品" href="<?php echo "/admin/products?type=" . $type["ID"] ?>" class="fRig" target="adminMain"> 查看商品</a>
                            </li>
                        <?php endforeach; ?>
                            <li class="fb l">
                                <span class="fLeft">全部</span>
                                <a title="类别商品" href="<?php echo "/admin/products?" ?>" class="fRig" target="adminMain"> 查看商品</a>
                            </li>
                        </ul>
                    </li>
                </ul>
                <div id="divMainBodyContent">
                    <div class="cls"></div>
                </div>
                <div id="divMainBodyContent">
                    <div class="fLeft" style="width:80px;">商品id</div>
                    <div class="fLeft" style="width:250px;">品名</div>
                    <div>
                        <ul id="productlist">
                            <li>售价</li>
                            <li>库存</li>
                            <li>出货量</li>
                            <li>修改</li>
                            <li>删除</li>
                        </ul>
                    </div>
                    <div class="cls"></div>
                </div>
            <?php foreach ($this->products as $product): ?>
                                <div id="divMainBodyContent">
                                    <div class="fLeft" style="width:50px;">
                    <?php echo $product["ID"] ?>
                            </div>
                            <div class="fLeft" style="width:280px;">
                    <?php echo $product[C_NAME] ?>
                            </div>
                            <div>
                                <ul id="productlist">
                                    <li><?php echo $product[C_PRICE] ?></li>
                                    <li><?php echo $product[C_NUM] ?></li>
                                    <li><?php echo $product[C_BUY_TIMES] ?></li>
                                    <li><a href="<?php echo "/admin/add-product?cmd=modify&id=" . $product["ID"] ?>" target="_self">修改</a></li>
                                    <li><a onClick="return delYesOrNo()" title="删除" href="<?php echo "/admin/add-product?cmd=delete&id=" . $product["ID"] ?>" target="_self">删除</a></li>
                                </ul>
                            </div>
                            <div class="cls"></div>
                        </div>
            <?php endforeach; ?>

            <div id="divMainBodyContent">
                <div id="divMainBodyContentTitle"></div>
                <div class="cls"></div>
            </div>
        </div>
        <script laguage="javascript">classesFix();</script>
    </body></html>